import request from '@/utils/request'

// 查询文件分类列表
export function listCategory(query) {
  return request({
    url: '/file/category/list',
    method: 'get',
    params: query
  })
}

// 查询文件分类详细
export function getCategory(id) {
  return request({
    url: '/file/category/getById/' + id,
    method: 'get'
  })
}

// 新增文件分类
export function addCategory(data) {
  return request({
    url: '/file/category/add',
    method: 'post',
    data: data
  })
}

// 修改文件分类
export function updateCategory(data) {
  return request({
    url: '/file/category/update',
    method: 'put',
    data: data
  })
}

// 删除文件分类
export function delCategory(id) {
  return request({
    url: '/file/category/delete/' + id,
    method: 'delete'
  })
}

// 导入文件分类
export function importCategory(data) {
    return request({
      url: '/file/category/import',
      method: 'post',
      data: data
    })
}

// 查询文件分类树形结构
export function getCategoryTree(query) {
  return request({
    url: '/file/category/tree',
    method: 'get',
    params: query
  })
}